﻿using System.Runtime.Serialization;
using System.Collections.ObjectModel;
using System.Collections.Generic;

namespace org.iringtools.library
{
  [DataContract(Namespace = "http://iringug.org/iringtools/library")]
  public class DataDictionary
  {
    [DataMember]
    public List<DataObject> dataObjects { get; set; }
  }

  [DataContract(Namespace = "http://iringug.org/iringtools/library")]
  public class DataObject
  {
    [DataMember]
    public List<DataProperty> dataProperties { get; set; }

    [DataMember]
    public List<DataRelationship> dataRelationships { get; set; }

    [DataMember]
    public string objectName { get; set; }

    [DataMember]
    public string objectNamespace { get; set; }
  }

  [DataContract(Namespace = "http://iringug.org/iringtools/library")]
  public class DataProperty
  {
    [DataMember]
    public string propertyName { get; set; }

    [DataMember]
    public bool isPropertyKey { get; set; }

    [DataMember]
    public bool isRequired { get; set; }

    [DataMember]
    public string dataType { get; set; }

    [DataMember]
    public string dataLength { get; set; }
  }

  [DataContract(Namespace = "http://iringug.org/iringtools/library")]
  public class DataRelationship
  {
    [DataMember]
    public string relatedObject { get; set; }

    [DataMember]
    public Cardinality cardinality { get; set; }
  }

  [DataContract(Namespace = "http://iringug.org/iringtools/library")]
  public enum Cardinality
  {
    [EnumMember]
    OneToMany,
    [EnumMember]
    ManyToOne,
    [EnumMember]
    OneToOne,
    [EnumMember]
    ManyToMany
  }
}
